import React, { Component } from 'react';
import { NavLink } from 'react-router-dom'

class Home extends Component {
  render() {
    const { routes } = this.props
    return <div className='home'>
      <header>
        <h2>电商后台管理系统</h2>
      </header>
      <main>
        <div className="left">
          {
            routes.map((item, index) => item.path ?
              <NavLink key={index} to={item.path}>
                {item.title}
              </NavLink> : null)
          }
        </div>
        <div className="right">
          {
            this.props.children
          }
        </div>
      </main>
    </div>
  }
}
export default Home